package com.rw.coco.data;

import com.rw.coco.api.data.CacheMapper;
import com.rw.coco.api.data.CocoDataApi;
import com.rw.coco.api.data.PersistenceMapper;
import com.rw.coco.data.data.FileCacheMapper;
import com.rw.coco.data.data.FilePersistenceMapper;

/**
 * 用文件实现机器人的数据接口
 */
public class FileCocoDataApi implements CocoDataApi {
    private final FileCacheMapper fileCacheMapper;
    private final FilePersistenceMapper filePersistenceMapper;

    /**
     * 日志打印接口，需要对接机器人平台
     */
    public FileCocoDataApi(String workPath) {
        fileCacheMapper = new FileCacheMapper(workPath);
        filePersistenceMapper = new FilePersistenceMapper(workPath);
    }

    @Override
    public CacheMapper getCacheMapper() {
        return fileCacheMapper;
    }

    @Override
    public PersistenceMapper getPersistenceMapper() {
        return filePersistenceMapper;
    }
}
